"""author: wangxin
   data: 2021/11/24
   project: 王鑫 容器作业.py
"""

import datetime

while 1:
    n = input("请输入一个整数：")
    if n.isdigit():
        today = datetime.datetime.now()
        last = datetime.timedelta(days=-int(n))
        lastday = (today + last).strftime('%Y-%m-%d')
        print(f"{n}天前的日期是{lastday}")
        break
    else:
        print("输入的不是整数，请重新输入")
